<div class="dialog">
    <table>
        <tbody>
        
            <tr class="prop">
                <td valign="top" class="name"><g:message code="pickplan.serialNumber" default="Serial Number" />:</td>
                <td valign="top" class="value">${fieldValue(bean: pickplanInstance, field: "serialNumber")}</td>

                <td valign="top" class="name"><g:message code="pickplan.date" default="Date" />:</td>
                <td valign="top" class="value"><g:formatDate date="${pickplanInstance?.date}" format="yyyy-MM-dd"/></td>

                <td valign="top" class="name"><g:message code="pickplan.maker" default="Maker" />:</td>
                <td valign="top" class="value"><g:link controller="staff" action="show" id="${pickplanInstance?.maker?.id}">
                    ${pickplanInstance?.maker?.encodeAsHTML()}</g:link>
                </td>
            </tr>
            
            <tr class="prop">
                <td valign="top" class="name">&nbsp;</td>
                <td valign="top" class="value">&nbsp;</td>

                <td valign="top" class="name"><g:message code="pickplan.director" default="Director" />:</td>
                <td valign="top" class="value"><g:link controller="staff" action="show" id="${pickplanInstance?.director?.id}">${pickplanInstance?.director?.encodeAsHTML()}</g:link></td>
           
                <td valign="top" class="name"><g:message code="pickplan.recordType" default="Record Type" />:</td>
                <td valign="top" class="value"><g:link controller="recordType" action="show" id="${pickplanInstance?.recordType?.id}">${pickplanInstance?.recordType?.encodeAsHTML()}</g:link></td>
            </tr>
            
        </tbody>
    </table>
</div>
<div class="list">
    <table>
        <thead>
            <tr>
                <th><g:message code="pickplanDetail.serialNumber" default="Serial Number" /></th>
                <th><g:message code="pickplanDetail.dealer" default="Dealer" /></th>
                <th><g:message code="pickplanDetail.product" default="Product" /></th>
                <th><g:message code="pickplanDetail.unit" default="Unit" /></th>
                <th class="number"><g:message code="pickplanDetail.quantity" default="Quantity" /></th>
                <th class="number"><g:message code="pickplanDetail.price" default="Price" /></th>
                <th class="number"><g:message code="pickplanDetail.amount" default="Amount" /></th>
            </tr>
        </thead>
        <tbody>
        <g:each in="${pickplanInstance.details}" status="i" var="pickplanDetailInstance">
            <tr class="${(i % 2) == 0 ? 'odd' : 'even'}">
                <td>${fieldValue(bean: pickplanDetailInstance, field: "serialNumber")}</td>
                <td>${fieldValue(bean: pickplanDetailInstance, field: "dealer")}</td>
                <td>${fieldValue(bean: pickplanDetailInstance, field: "product")}</td>
                <td>${fieldValue(bean: pickplanDetailInstance, field: "unit")}</td>
                <td class="number"><g:formatNumber number="${pickplanDetailInstance.quantity}" format="###,##0.00"/></td>
                <td class="number"><g:formatNumber number="${pickplanDetailInstance.price}" format="###,##0.00"/></td>
                <td class="number"><g:formatNumber number="${pickplanDetailInstance.amount}" format="###,##0.00"/></td>
            </tr>
        </g:each>
        </tbody>
        <tfoot>
            <tr>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td class="number"><g:formatNumber number="${pickplanInstance?.details*.quantity.sum()}" format="###,##0.00"/></td>
                <td></td>
                <td class="number"><g:formatNumber number="${pickplanInstance?.details*.amount.sum()}" format="###,##0.00"/></td>
            </tr>
        </tfoot>
     </table>
</div>

